<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
<ui:composition template="/template/template.xhtml">
	<ui:define name="header">
	    <div id="menu">
			<ul>
				<li><h:outputLink value="admin.xhtml"><h:outputText value="#{msg.home}"/></h:outputLink></li>
				<li><h:outputLink value="cadastro.xhtml"><h:outputText value="#{msg.cadastrar}"/></h:outputLink></li>
				<li><h:outputLink value="remover.xhtml"><h:outputText value="#{msg.remover}"/></h:outputLink></li>
				<li><h:outputLink value="alterar.xhtml"><h:outputText value="#{msg.alterar}"/></h:outputLink></li>
				<li><h:outputLink value="lrecados.xhtml"><h:outputText value="#{msg.recados}"/></h:outputLink></li>
				<li class="current_page_item"><h:outputLink value="mensagem.xhtml"><h:outputText value="#{msg.mensagem}"/></h:outputLink></li>
				<li><h:commandLink action="#{LoginBean.sair}"><h:outputText value="#{msg.encerrar}"/></h:commandLink></li>
			</ul>
		</div>
	</ui:define>
	<ui:define name="content">
	<f:verbatim escape="true">
		${msgadmin}
		${msgcli}
	</f:verbatim>
	    <div class="post">
			<h2 class="title" style="text-align:center"><h:outputLink value="#">Acervo Digital de Filmes</h:outputLink></h2>
			<p class="meta"></p>
			  <div class="entry">
			      <p style="text-align:justify"></p>
				  <p>
						<p:growl/>
						
						<p:fieldset legend="#{msg.msgall}" toggleable="true" toggleSpeed="500" collapsed="true">
						
							<h:panelGrid border="0" columns="2">
								<h:outputText value="#{msg.mensagem}: " /><h:outputText/>
								<p:inputTextarea id="mensagem" rows="8" cols="30" value="#{UsuarioBean.mensagem}"/>
								
								<h:outputText/>
								<h:panelGroup>
									<div style="text-align: right;">
										<h:commandButton value="#{msg.enviar}" type="submit" action="#{UsuarioBean.enviarMensagens}"/>
									</div>
								</h:panelGroup>
							</h:panelGrid>
						
						</p:fieldset>
						
						<br/>
						
						<p:fieldset legend="#{msg.agendarservico}" toggleable="true" toggleSpeed="500" collapsed="true">
							<h:panelGrid border="0" colums="4">	
								<h:panelGroup>
									<h:outputText value="id "/>
									<h:inputText value="#{timerService.inputId}"/>
									<h:outputText/><h:outputText/>
								</h:panelGroup>
								
								<h:panelGroup>
									<h:outputText value="Nome "/>
									<h:inputText value="#{timerService.inputNome}"/>
									<h:outputText/><h:outputText/>
								</h:panelGroup>
									
								<h:panelGroup>
									<h:outputText value="Mensagem"/>
									<h:outputText/><h:outputText/><h:outputText/>
								</h:panelGroup>
								
								<h:panelGroup>
									<h:inputTextarea value="#{timerService.inputMensagem}" />
									<h:outputText/><h:outputText/><h:outputText/>
								</h:panelGroup>
								
								<h:panelGroup>
									<h:outputText value="Data"/>
									<p:keyboard value="#{timerService.inputDia}" keypadOnly="true" size="1" maxlenght="2"/> / 
									<p:keyboard value="#{timerService.inputMes}" keypadOnly="true" size="1" maxlenght="2"/> / 
									<p:keyboard value="#{timerService.inputAno}" keypadOnly="true" size="1" maxlenght="4"/>
								</h:panelGroup>
								
								<h:panelGroup>
									<h:outputText value="Hora"/>
									<p:keyboard value="#{timerService.inputHora}" keypadOnly="true" size="1" maxlenght="2"/> : 
									<p:keyboard value="#{timerService.inputMinuto}" keypadOnly="true" size="1" maxlenght="2"/>
								</h:panelGroup>
								
								<h:panelGroup>
									<div style="text-align: right;">
										<h:commandButton value="Agendar" action="#{timerService.cadastra}" type="submit"/>
									</div>
								</h:panelGroup>
							</h:panelGrid>	
						</p:fieldset>
						
						<br/>
						
						
						<h:form>
						<p:fieldset  legend="#{msg.servicosagendados}" toggleable="true" toggleSpeed="500" collapsed="true">
							
							<p:dataTable id="items" border="1" value="#{timerService.listaTimers}" var="item">
								
								<p:column headerText="Selecione">
									<h:selectBooleanCheckbox value="#{item.selecionado}" />
								</p:column>
								
								<p:column headerText="Id">
									<h:outputText value="#{item.id}" />
								</p:column>
								
								<p:column headerText="Proprietario">
									<h:outputText value="#{item.proprietario}" />
								</p:column>
								
								<p:column headerText="Mensagem">
									<h:outputText value="#{item.mensagem}" />
								</p:column>
								
								<p:column headerText="Data">
									<h:outputText value="#{item.data}">
										<f:convertDateTime timeZone="America/Sao_Paulo" pattern="dd/MM/yyyy HH:mm"/>
									</h:outputText>
								</p:column>
								
							</p:dataTable>
							
							<h:panelGrid>
								<div style="text-align: right;">
									<h:commandButton value="#{msg.excluir}" action="#{timerService.exclui}"/>
								</div>
							</h:panelGrid>
						
						</p:fieldset>
						
						<br/>
						</h:form>
				  </p>
			</div>
		</div>
		<div style="clear: both; height: 208px;"></div>
	</ui:define>
</ui:composition>
</html>